﻿<head> 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 

<?php
require_once('../connections/connect.php');

    mysql_select_db($database_connect, $connect);
    $query_q = "SELECT * FROM DMA_list group by BRANCH";
    $q = mysql_query($query_q, $connect) or die(mysql_error());
    //echo '<select style="width:90%;" id="zone" name="zone">' ;
    echo '<option value="" selected="selected" > ---- เลือก สาขา ---- </option>';
    while($row_q = mysql_fetch_array($q)){
        $id = $row_q["BRANCH"];
        $branchName = branchName($id);
        //$name = $row_q["branch_name"];
        echo"<option value='$id'>$id $branchName</option>";
        //echo "$id";
        
    };
    //echo '</select>' ;
    
    
    function branchName($id){
        
        $branch ="สาขา";
        
        
        if($id=='01'){
			$branchname = "บางกอกน้อย";
		}else if($id=='02'){
			$branchname = "ตากสิน";
		}else if($id=='03'){
			$branchname = "พญาไท";
		}else if($id=='04'){
			$branchname = "นนทบุรี";
		}else if($id=='05'){
			$branchname = "ทุ่งมหาเมฆ";
		}else if($id=='06'){
			$branchname = "แม้นศรี";
		}else if($id=='07'){
			$branchname = "สุขุมวิท";
		}else if($id=='11'){
			$branchname = "ภาษีเจริญ";
		}else if($id=='12'){
			$branchname = "ลาดพร้าว";
		}else if($id=='13'){
			$branchname = "พระโขนง";
		}else if($id=='14'){
			$branchname = "สุขสวัสดิ์";
		}else if($id=='15'){
			$branchname = "ประชาชื่น";
		}else if($id=='16'){
			$branchname = "บางเขน";
		}else if($id=='17'){
			$branchname = "สมุทรปราการ";
		}else if($id=='53'){
			$branchname = "มีนบุรี";
		}else if($id=='54'){
			$branchname = "บางบัวทอง";
		}else if($id=='55'){
			$branchname = "สุวรรณภูมิ";
		}else if($id=='56'){
			$branchname = "มหาสวัสดิ์";
                }
	return $branch.$branchname;
        
        
    }

?>
 ﻿</head> 
